package com.thougtful.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * @author yushun
 * @createTime 2022/10/18 - 11:04
 **/
@Getter
@AllArgsConstructor
public enum CompressTypeEnum {

    GZIP((byte) 0x01, "gzip"),
    ;

    private final byte code;

    private final String name;

    public static String getName(byte code) {
        for (CompressTypeEnum typeEnum : CompressTypeEnum.values()) {
            if (typeEnum.getCode() == code) {
                return typeEnum.getName();
            }
        }
        return null;
    }


}
